<?php
if(!defined('IN_XLR')) {
	exit('Access Denied');
}

//约练详情
function api_invite_detail($apiReq){
	global $_SGLOBAL, $_CONFIG;

    if(!isset($apiReq["id"])){
	     $apiOut["returncode"] = "2000";
	     return $apiOut;
	}

	$inviteid = $apiReq["id"];
	
	$sql = "select a.*,a.id as invite_id,b.nickname,b.thumb,b.height,b.sex from invite a,member b where a.member_id=b.id and a.id='$inviteid'";
 	$invite = get_db()->get_row($sql);
 	if(!$invite){
         $apiOut["returncode"] = "2001";
	     return $apiOut;
 	}

 	$invite_id = $invite->id;
 	$sql = "select a.*,a.id as invite_replay_id,b.nickname,b.thumb from invite_reply a,member b where a.member_id=b.id and a.invite_id='$invite_id'";
	$replys = get_db()->get_results($sql);
	if(!$replys){
		$replys = '';
	}
  
	//输出
	$apiOut["returncode"] = "0";
 	$apiOut["apiReq"] = $apiReq;
 	$apiOut["invite"] = $invite;
 	$apiOut["replys"] = $replys;
 
	return $apiOut;
}
